/*
* =====================================================================================
*
*       Filename:  assert.h
*
*    Description:  
*
*        Version:  1.0
*        Created:  2010年09月19日 09时18分10秒
*       Revision:  none
*       Compiler:  gcc
*
*         Author:  YOUR NAME (), 
*        Company:  
*
* =====================================================================================
*/
#ifndef ASSERT_INCLUDE
#define ASSERT_INCLUDE

#include "except.h"

extern except_t Assertion_Failed;

#ifndef NDEBUG
#define assert(s) assert_a_assert((s), __FILE__, __LINE__)
#else
#define assert(s) do {} while (0)
#endif

#define assert_a_assert(s, file, line) do { \
	if (!(s)) { \
		except_raise(&(Assertion_Failed), file, line); \
	}  \
} while (0);

#endif
